<?php

namespace app\validate;

use share\validate\SceneValidate;

class TutorialVideoValidate extends SceneValidate{
    protected $rule = [
        'id' => 'require',
        'state' => 'require|min:16',
        'encode' => 'require|min:30',
        'userId' => 'require|length:30,64',
        'token' => 'require|length:30,64',
        'language' =>  'require|max:10', 
        'vendor' => 'require|max:30', 
        'moduleId' => 'require|integer|>=:1',
        'title' => 'require|length:1,100',
        'system' => 'require|length:2,64',
        'url' => 'require|length:4,1000',
        'defaultPicture' => 'require|length:1,1000',
        'modelId' => 'require|integer|>=:1',
        'titleName' => 'require|min:1',
        'lang' => 'require|length:2',
    ];  
    protected $sceneRules = [
        'edit' => [
            'id' => 'require',
            'title' => 'length:1,100',
            'system' => 'length:2,64',
            'url' => 'length:4,1000',
            'vendor' => 'max:30', 
            'defaultPicture' => 'length:1,1000',          
        ],
        'list' => [
            'vendor' => 'max:30', 
            'language' =>  'require|max:10', 
        ],
    ];

    protected $scene = [
        'listModule' => ['language','state','encode','userId','token'],
        'moduleInfo' => ['language','vendor','moduleId','state','encode','userId','token'],
        'search' => ['language','vendor','title','state','encode','userId','token'],
        'add' => ['system','url','vendor','defaultPicture','modelId','titleName','language'],
        'edit' => ['id','system','url','vendor','defaultPicture'],
        'del' => ['id'],
        'list' => ['vendor','language'],
        'all' => ['lang'],
    ];
}